package mss

import (
	"log"

	"google.golang.org/grpc"
	"google.golang.org/grpc/grpclog"
)

func GRPCClient(Address string, callback func(conn *grpc.ClientConn)) {
	if callback == nil {
		log.Fatal("callback is nil")
		return
	}
	connection, error := grpc.Dial(Address, grpc.WithInsecure())
	if error != nil {
		grpclog.Fatalln(error)
		return
	}
	defer connection.Close()
	callback(connection)
}
